package Stream;

import java.util.ArrayList;

public class demo1 {
    public static void main(String[] args) {
        ArrayList<String> list=new ArrayList<>();
        list.add("张一");
        list.add("张二三");
        list.add("张三");
        list.add("李一");
        list.add("李二");
        list.add("李三");
        list.stream().filter(name->name.startsWith("张")).filter(name->name.length()==3).
                forEach(name-> System.out.println(name));
    }

}
